//////////Change the directory before running the code
///////// Panel A
cd "D:\data&code"
quietly {

	///// Load panel
	use pseudo_dataset/informativeness, clear

	////// Regressions

	/////////// Fund and firm controls

	//// Voting correctly
	reghdfe correct   						///
			logmv              				///
			q_CCM       	        		///
			roa_CCM                 		///
			leverage_CCM            		///
			divyld_CCM              		///
			hhi 							///
			inst_13f 						///
			hf  							///
			no_camp 						///
			share_intensity 				///
			passive 						///
			log_port_val 					///
			port_share						///	
			horizon 						///
			basis_ret                   	///
			, 								///
			absorb(proxy_year ff48) 		///
			vce(cluster fund_family)
			
	outreg2 using table_9a,  						///
			dta 									///
			tstat 									///
			adjr2 									///
			bdec(3) 								///
			tdec(2)  								///
			bracket 								///
			nocons 									///
			label 									///
			keep ( 									///
				passive 							///
			)										///
			replace		
			
	//// Type I error
	reghdfe typeI   						///
			logmv              				///
			q_CCM       	        		///
			roa_CCM                 		///
			leverage_CCM            		///
			divyld_CCM              		///
			hhi 							///
			inst_13f 						///
			hf  							///
			no_camp 						///
			share_intensity 				///
			passive 						///
			log_port_val 					///
			port_share						///	
			horizon 						///
			basis_ret                   	///
			, 								///
			absorb(proxy_year ff48) 		///
			vce(cluster fund_family)
			
	outreg2 using table_9a,  						///
			dta 									///
			tstat 									///
			adjr2 									///
			bdec(3) 								///
			tdec(2)  								///
			bracket 								///
			nocons 									///
			label 									///
			keep ( 									///
				passive 							///
			)										///
			append
			
	//// Type II error
	reghdfe typeII   						///
			logmv              				///
			q_CCM       	        		///
			roa_CCM                 		///
			leverage_CCM            		///
			divyld_CCM              		///
			hhi 							///
			inst_13f 						///
			hf  							///
			no_camp 						///
			share_intensity 				///
			passive 						///
			log_port_val 					///
			port_share						///	
			horizon 						///
			basis_ret                   	///
			, 								///
			absorb(proxy_year ff48) 		///
			vce(cluster fund_family)
			
	outreg2 using table_9a,  						///
			dta 									///
			tstat 									///
			adjr2 									///
			bdec(3) 								///
			tdec(2)  								///
			bracket 								///
			nocons 									///
			label 									///
			keep ( 									///
				passive 							///
			)										///
			append
			
	//////////////////////// Event FE		
			
	//// Voting correctly
	reghdfe correct   						///
			passive 						///
			log_port_val 					///
			port_share						///	
			horizon 						///
			basis_ret                   	///
			, 								///
			absorb(pf_no) 					///
			vce(cluster fund_family)
			
	outreg2 using table_9a,  						///
			dta 									///
			tstat 									///
			adjr2 									///
			bdec(3) 								///
			tdec(2)  								///
			bracket 								///
			nocons 									///
			label 									///
			keep ( 									///
				passive 							///
			)										///
			append		

	//// TypeI
	reghdfe typeI  							///
			passive 						///
			log_port_val 					///
			port_share						///	
			horizon 						///
			basis_ret                   	///
			, 								///
			absorb(pf_no) 	///
			vce(cluster fund_family)
			
	outreg2 using table_9a,  						///
			dta 									///
			tstat 									///
			adjr2 									///
			bdec(3) 								///
			tdec(2)  								///
			bracket 								///
			nocons 									///
			label 									///
			keep ( 									///
				passive 							///
			)										///
			append		
			
	//// TypeII
	reghdfe typeII  						///
			passive 						///
			log_port_val 					///
			port_share						///	
			horizon 						///
			basis_ret                   	///
			, 								///
			absorb(pf_no) 					///
			vce(cluster fund_family)
			
	outreg2 using table_9a,  						///
			dta 									///
			tstat 									///
			adjr2 									///
			bdec(3) 								///
			tdec(2)  								///
			bracket 								///
			nocons 									///
			label 									///
			keep ( 									///
				passive 							///
			)										///
			append			
}

/////// View regression
use table_9a_dta, clear
rm table_9a.txt
browse
				
////////////////////////////////////////////////////////////////////////

///////// Panel B

quietly {

/////////

///// Load panel
use pseudo_dataset/informativeness, clear

////// Regressions

/////////// Fund and firm controls

//// Voting correctly
reghdfe correct   						///
		logmv              				///
		q_CCM       	        		///
		roa_CCM                 		///
		leverage_CCM            		///
		divyld_CCM              		///
		hhi 							///
		inst_13f 						///
		hf  							///
		no_camp 						///
		share_intensity 				///
		passive_big3 					///
		passive_xbig3 					///
		log_port_val 					///
		port_share						///	
		horizon 						///
		basis_ret                   	///
		, 								///
		absorb(proxy_year ff48) 		///
		vce(cluster fund_family)
		
outreg2 using table_9b,  		    			///
        dta 									///
		tstat 									///
		adjr2 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		label 									///
		keep ( 									///
			passive_big3 passive_xbig3			///
		)										///
		replace		
		
//// Type I error
reghdfe typeI   						///
		logmv              				///
		q_CCM       	        		///
		roa_CCM                 		///
		leverage_CCM            		///
		divyld_CCM              		///
		hhi 							///
		inst_13f 						///
		hf  							///
		no_camp 						///
		share_intensity 				///
		passive_big3 passive_xbig3 		///
		log_port_val 					///
		port_share						///	
		horizon 						///
		basis_ret                   	///
		, 								///
		absorb(proxy_year ff48) 		///
		vce(cluster fund_family)
		
outreg2 using table_9b,  		   		 		///
        dta 									///
		tstat 									///
		adjr2 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		label 									///
		keep ( 									///
			passive_big3 passive_xbig3 			///
		)										///
		append
		
//// Type II error
reghdfe typeII   						///
		logmv              				///
		q_CCM       	        		///
		roa_CCM                 		///
		leverage_CCM            		///
		divyld_CCM              		///
		hhi 							///
		inst_13f 						///
		hf  							///
		no_camp 						///
		share_intensity 				///
		passive_big3 passive_xbig3 		///
		log_port_val 					///
		port_share						///	
		horizon 						///
		basis_ret                   	///
		, 								///
		absorb(proxy_year ff48) 		///
		vce(cluster fund_family)
		
outreg2 using table_9b,  		 	 	  		///
        dta 									///
		tstat 									///
		adjr2 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		label 									///
		keep ( 									///
			passive_big3 passive_xbig3 			///
		)										///
		append
		
//////////////////////// Event FE		
		
//// Voting correctly
reghdfe correct   						///
		passive_big3 passive_xbig3 		///
		log_port_val 					///
		port_share						///	
		horizon 						///
		basis_ret                   	///
		, 								///
		absorb(pf_no) 					///
		vce(cluster fund_family)
		
outreg2 using table_9b,  		    			///
        dta 									///
		tstat 									///
		adjr2 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		label 									///
		keep ( 									///
			passive_big3 passive_xbig3 			///
		)										///
		append		

//// TypeI
reghdfe typeI  							///
		passive_big3 passive_xbig3 		///
		log_port_val 					///
		port_share						///	
		horizon 						///
		basis_ret                   	///
		, 								///
		absorb(pf_no) 					///
		vce(cluster fund_family)
		
outreg2 using table_9b,  		  			 	///
        dta 									///
		tstat 									///
		adjr2 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		label 									///
		keep ( 									///
			passive_big3 passive_xbig3 			///
		)										///
		append		
		
//// TypeII
reghdfe typeII  						///
		passive_big3 passive_xbig3 		///
		log_port_val 					///
		port_share						///	
		horizon 						///
		basis_ret                   	///
		, 								///
		absorb(pf_no) 					///
		vce(cluster fund_family)
		
outreg2 using table_9b,  		    			///
        dta 									///
		tstat 									///
		adjr2 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		label 									///
		keep ( 									///
			passive_big3 passive_xbig3 			///
		)										///
		append			

}

/////// View regression
use table_9b_dta, clear
rm table_9b.txt
browse
